package com.service.scheduling.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.service.dao.mapper.WalletConfigMapper;
import com.service.dao.model.CoinsPrice;
import com.service.dao.model.WalletConfig;
import com.service.scheduling.service.WalletConfigService;
import org.springframework.stereotype.Service;

@Service
public class WalletConfigServiceImpl extends ServiceImpl<WalletConfigMapper, WalletConfig> implements WalletConfigService {
	/**
	 * 根据coin名称获取钱包配置
	 *
	 * @param coin
	 * @return
	 */
	@Override
	public WalletConfig getByCoin(String coin) {
		return getOne(new QueryWrapper<WalletConfig>().lambda()
				.eq(WalletConfig::getCoin, coin).last(" limit 1"));
	}
}
